@extends('d.layout.index')
@section('con')
<div class="mws-panel grid_8">
 	<div class="mws-panel-header">
     	<span>商品基本信息编辑</span>
     </div>
     <div class="mws-panel-body no-padding">
     	<form class="mws-form" action="/admin/goods/updatemain" method="post" enctype="multipart/form-data">
               {{csrf_field()}}
               <input type="hidden" name="id" value="{{$v['id']}}">
     		<div class="mws-form-inline">
     			<div class="mws-form-row">
     				<label class="mws-form-label">商品种类</label>
                         <div class="mws-form-item">
                              <select class="small" name="tid">
                                   @foreach($list as $value)
                                   <option value="{{$value['id']}}" @if($v['tid'] == $value['id'])selected @endif>{{$value['name']}}</option>
                                   @endforeach
                              </select>
                         </div>
     			</div>    			
     		</div>
               <div class="mws-form-inline">
                    <div class="mws-form-row">
                         <label class="mws-form-label">商品名称</label>
                         <div class="mws-form-item">
                              <input type="text" name='name' class="small" value="{{$v['name']}}">
                         </div>
                    </div>                   
               </div>
               <div class="mws-form-inline">
                    <div class="mws-form-row">
                         <label class="mws-form-label">商品价格</label>
                         <div class="mws-form-item">
                              <input type="text" name='price' class="small" value="{{$v['price']}}">
                         </div>
                    </div>                   
               </div>
               <div class="mws-form-inline">
                    <div class="mws-form-row">
                         <label class="mws-form-label">商品折扣价</label>
                         <div class="mws-form-item">
                              <input type="text" name='on_sale' class="small" value="{{$v['on_sale']}}">
                         </div>
                    </div>                   
               </div>
               <div class="mws-form-inline">
                    <div class="mws-form-row">
                         <label class="mws-form-label">商品图片</label>
                         <div class="mws-form-item">
                              <img src="/goods/pic/{{$v['pic']}}" style="width:100px" alt=""><br>
                              <input type="file" name="pic">
                         </div>
                    </div>                   
               </div>
               <div class="mws-form-inline">
                    <div class="mws-form-row">
                         <label class="mws-form-label">列表图片1</label>
                         <div class="mws-form-item">
                              @if(array_key_exists('pic1',$v))
                              <img src="/goods/pic/{{$v['pic1']}}" alt=""><br>
                              @endif
                              <input type="file" name="pic1">
                         </div>
                    </div>                   
               </div>
               <div class="mws-form-inline">
                    <div class="mws-form-row">
                         <label class="mws-form-label">列表图片2</label>
                         <div class="mws-form-item">
                              @if(array_key_exists('pic2',$v))
                              <img src="/goods/pic/{{$v['pic2']}}" alt=""><br>
                              @endif
                              <input type="file" name="pic2">
                         </div>
                    </div>                   
               </div>
               <div class="mws-form-inline">
                    <div class="mws-form-row">
                         <label class="mws-form-label">列表图片3</label>
                         <div class="mws-form-item">
                              @if(array_key_exists('pic3',$v))
                              <img src="/goods/pic/{{$v['pic3']}}" alt=""><br>
                              @endif
                              <input type="file" name="pic3">
                         </div>
                    </div>                   
               </div>
               <div class="mws-form-inline">
                    <div class="mws-form-row">
                         <label class="mws-form-label">列表图片4</label>
                         <div class="mws-form-item">
                              @if(array_key_exists('pic4',$v))
                              <img src="/goods/pic/{{$v['pic4']}}" alt=""><br>
                              @endif
                              <input type="file" name="pic4">
                         </div>
                    </div>                   
               </div>
               <div class="mws-form-inline">
                    <div class="mws-form-row">
                         <label class="mws-form-label">商品介绍</label>
                         <div class="mws-form-item">
                              <textarea name="desc" class="error small" cols="30" rows="10">{{$v['desc']}}</textarea>
                         </div>
                    </div>                   
               </div>
     		<div class="mws-button-row">
     			<input type="submit" value="修改" class="btn btn-danger">
     			<input type="reset" value="重置" class="btn ">
     		</div>
     	</form>
     </div>    	
</div>
@endsection